package com.uw.uwrpc.demo.provider;

import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import com.uw.uwconfig.client.annotation.EnableUwConfig;
import com.uw.uwrpc.core.annotation.EnableUWService;
import com.uw.uwrpc.core.config.UWRpcProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Hello world!
 */
@RestController
@SpringBootApplication
@EnableUWService
@EnableUwConfig
//@EnableApolloConfig
public class UwrpcDemoProviderApplication {
    public static void main(String[] args) {
        SpringApplication.run(UwrpcDemoProviderApplication.class, args);
    }


    @Autowired
    UWRpcProperty uwRpcProperty;

    @RequestMapping("/metas")
    public String meta() {
        System.out.println(System.identityHashCode(uwRpcProperty.getProvider().getMetas()));
        return uwRpcProperty.getProvider().getMetas().toString();
    }

}
